package JavaSE.CODE.javaIO;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;

public class InputStreamReaderDemo {
    public static void main(String[] args) throws Exception{
        InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream("D:\\liric.txt"), StandardCharsets.UTF_8);
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(new FileOutputStream("D:\\lyrics.txt"),StandardCharsets.UTF_8);

        int data=0;
        while((data=inputStreamReader.read())!=-1){
            outputStreamWriter.write((char)data);
        }

        inputStreamReader.close();
        outputStreamWriter.close();
    }
}
